/**
 * Created with JetBrains PhpStorm.
 * User: Artem
 * Date: 11.03.13
 * Time: 16:32
 * To change this template use File | Settings | File Templates.
 */

Ext.define("Pro.view.AddNewEmployee", {
    extend: "Ext.window.Window",
    alias: "widget.addnewemployee",

    title: localization.EDD_NEW_EMPLOYEE_TITLE || "Add New Employee",

    layout: "card",
    height: 300,
    width: 400,
    resizable: false,
    id: "m-edd-new-employee",

    autoShow: true,

    items: [
        {
            xtype: "panel",
            bodyPadding: 10,
            items: [
                {
                    xtype: "panel",
                    bodyPadding: 10,
                    height: 180,
                    html: "<h1>" + localization.EDD_NEW_EMPLOYEE_WIZARD_MESSAGE_1 || "Do You want to create a new employee?" + "</h1>"
                },
                {
                    xtype: "checkbox",
                    id: "yesIWant",
                    boxLabel: localization.EDD_NEW_EMPLOYEE_CHECKBOX_LABEL || "Yes, I want"
                }
            ]
        },
        {
            xtype: "panel",
            bodyPadding: 10,
            items: [
                {
                    xtype: "panel",
                    bodyPadding: 10,
                    height: 180,
                    html: "<h1> " + localization.EDD_NEW_EMPLOYEE_WIZARD_MESSAGE_2 || "You should select team for new Employee" + "</h1>"
                },
                {
                    xtype: "combobox",
                    margin: "10 0 0 0",
                    fieldLabel: localization.EDD_NEW_EMPLOYEE_COMBOBOX_LABEL || "Available team",
                    store: "Teams",
                    id: "teamBox",
                    displayField: "name",
                    queryMode: "remote"
                }
            ]
        },
        {
            xtype: "form",
            bodyPadding: 10,
            id: "addEmployeeFormPanel",
            items:[
                {
                    xtype: 'textfield',
                    fieldLabel: localization.EDD_NEW_EMPLOYEE_FORM_LABEL_NAME || "Name",
                    name: 'name'
                },
                {
                    xtype: 'textfield',
                    name: 'age',
                    fieldLabel: localization.EDD_NEW_EMPLOYEE_FORM_LABEL_AGE || "Age"
                },
                {
                    xtype: 'textfield',
                    name: 'phone',
                    fieldLabel: localization.EDD_NEW_EMPLOYEE_FORM_LABEL_PHONE || "Phone"
                },
                {
                    xtype: "textfield",
                    name: "team",
                    hidden: true
                },
                {
                    xtype: "radiogroup",
                    fieldLabel: localization.EDD_NEW_EMPLOYEE_FORM_LABEL_MARRIED || "Married",
                    defaultType: "radiofield",
                    layout: "vbox",
                    items: [
                        {
                            boxLabel: localization.EDD_NEW_EMPLOYEE_FORM_LABEL_MARRIED_TRUE || "Married",
                            name: "married",
                            inputValue: true
                        },
                        {
                            boxLabel: localization.EDD_NEW_EMPLOYEE_FORM_LABEL_MARRIED_FALSE || "Free",
                            name: "married",
                            inputValue: false,
                            checked: true
                        }
                    ]
                }
            ]
        }
    ],

    bbar: [
        "->",
        {
            xtype: "button",
            text: localization.EDD_NEW_EMPLOYEE_BUTTON_BACK || "Back",
            id: "back",
            disabled: true
        },
        {
            xtype: "button",
            text: localization.EDD_NEW_EMPLOYEE_BUTTON_NEXT || "Next",
            id: "next",
            disabled: true
        },
        {
            xtype: "button",
            text: localization.EDD_NEW_EMPLOYEE_BUTTON_FINISH || "Finish",
            id: "finish",
            hidden: true
        }
    ]
});